﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using HengTong.Model.Db;
using HengTong.Model.Db.Other;
using TiaoTaoHelper.Wtm.Models;


namespace HengTong.ViewModel.Visitor.SysVisitorReasonVms
{
    public partial class SysVisitorReasonTemplateVm : BaseTemplateVM
    {
        [Display(Name = "事由名称")]
        public ExcelPropety ReasonNameExcel = ExcelPropety.CreateProperty<SysVisitorReason>(x => x.ReasonName);
        [Display(Name = "所属部门")]
        public ExcelPropety GroupExcel = ExcelPropety.CreateProperty<SysVisitorReason>(x => x.GroupId);
        [Display(Name = "是否有效")]
        public ExcelPropety IsActiveExcel = ExcelPropety.CreateProperty<SysVisitorReason>(x => x.IsActive);

	    protected override void InitVM()
        {
            GroupExcel.DataType = ColumnDataType.ComboBox;
            GroupExcel.ListItems = DC.Set<SysGroup>().GetSelectListItems(Wtm, y => y.GroupName);
        }

    }

    public class SysVisitorReasonImportVm : BaseImportVM<SysVisitorReasonTemplateVm, SysVisitorReason>
    {

    }

}
